/*
 * Copyright (c) Extreme Vision Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef __ATLAS_MODEL_HAMDLE_H__
#define __ATLAS_MODEL_HANDLE_H__
#include <string>

namespace ev
{

    class AtlasModelHandle
    {
      public:
        explicit AtlasModelHandle();
        ~AtlasModelHandle();

        /**
         * @brief use ATC tool to convert input model to OM model
         * @param[in] input_model_name: input model name (please use absolute path) to be converted, input model file is
         * normally encrypted.
         * @param[in] output_model_name: output model name (please use absolute path), converted OM model
         * @param[in] cmd_str: ATC tool conversion cmd (e.g.,
         * atc --model=yolov5s.onnx --framework 5 --output=yolov5s_bs --soc_version=Ascend310
         * --input_format=NCHW --input_shape="images:1,3,640,640" --input_fp16_nodes="images"
         * --output_type=FP16 --optypelist_for_implmode="Sigmoid" --op_select_implmode=high_performance)
         * @return int:  -1 failed, 0  succeeded
         */
        int convertOM(const std::string &input_model_name, const std::string &output_model_name,
                      const std::string &cmd_str);
        /**
         * @brief load atlas om model
         * @param[in] om_model_name: input om model(please use absolute path)
         * @param[in] model_id: load om model to model_id
         * @return int:  -1 failed, 0 succeeded
         */
        int loadModel(const std::string &om_model_name, uint32_t &model_id);
    };

} // end namespace ev
#endif
